package com.mars.admin.modules.app;

import com.mars.admin.framework.common.Result;
import com.mars.admin.modules.activity.entity.Activity;
import com.mars.admin.modules.banner.entity.Banner;
import com.mars.admin.modules.banner.service.BannerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 轮番图控制器
 */
@Slf4j
@RestController
@RequestMapping("/api/banner")
@Tag(name = "轮番图管理", description = "轮番图相关接口")
@AllArgsConstructor
public class BannerController {

    @Autowired
    private BannerService bannerService;

    /**
     * 查询全部的轮廓图
     */
    @GetMapping("/list/{type}")
    @Operation(summary = "获取轮番图", description = "获取轮番图")
    public Result<List<Banner>> getBannerList(@PathVariable String type) {
        List<Banner> list = bannerService.listAll(type);
        return Result.success(list);
    }
}
